package io.renren.common.config.rabbit;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @ClassName DeadLetterListener
 * @Description: TODO
 * @Author HeJie  734412450@qq.com
 * @Date 2021/1/26  22:16
 * @Version V1.0
 **/
@Component
public class DeadLetterListener {

    @RabbitListener(queues = {"order.release.queue"})
    public void test(Message msg, String str, Channel channel){
        System.out.println(msg);
        System.out.println(str);
        try {
            channel.basicAck(msg.getMessageProperties().getDeliveryTag(),false);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
